<?php
/**
 * 使用说明  默认控制器  资费说明
 */
class Controller_web extends Controller_Abstract
{
   function _before_execute(){
        if(!in_array($this->_context->action_name, array('warhouse','focus','intro','excptioncue','dec','okcue')))
        {
            exit('非法请求');
        }
   }
    
	function actionintro(){  
	     $sid = intval($this->_context->sid);
	     $o = Acct::find('id = ?',$sid)->getOne();
	     $this->_view['info'] = $o;
	}

	
	/**
	 * 异常提示
	 */
	function actionexcptioncue(){
	  $cue = urldecode($this->_context->cue);
	  $this->_view['cue'] = $cue;
	  $url = trim($this->_context->url);
	  $this->_view['url'] = $url;
	}
	/**
	 * 异常提示
	 */
	function actionokcue(){
		
	    $cue = urldecode($this->_context->cue);
	    $this->_view['cue'] = $cue;

	    $url = urldecode($this->_context->url);
	    $this->_view['url'] = $url;
	}
	
	
	

	function actionwarhouse(){//根据距离排序
	    
	    $content = $this->_context->content;
	    $eare = intval($this->_context->eare);
	    $param = array();
	    $param['content'] = $content;
	    $param['eare'] = $eare;
	    if(!empty($content) || !empty($eare)){
	    	if(!empty($content) && empty($eare)){
	    		$warhouse = department::find("is_warhouse = 1 and (`name` like '%?%' or `address` like '%?%') ",$content,$content)->getAll(); 
	    	}
	    	if(!empty($eare) && empty($content)){
	    		$warhouse = department::find("is_warhouse = 1 and eare_id",$eare)->getAll(); 
	    	}
	    	if(!empty($eare) && !empty($content)){
	    		$warhouse = department::find("is_warhouse = 1 and (`name` like '%?%' or `address` like '%?%') and eare_id = ?",$content,$content,$eare)->getAll(); 
	    	}
	        
	    }else{
	        $warhouse = department::find('is_warhouse = 1 and is_yl = 0')->getAll();
	    }
	    $regionlist = region::getregionlist();
	    $this->_view['param'] = $param;
	    $this->_view['warhouse'] = $warhouse;
	    $this->_view['regionlist'] = $regionlist;
	    
	}
	
	/**
	 * 公司介绍
	 */
	function actiondec(){
	   
	    $acct = Acct::find('id = ?',1)->getOne();
	    $dec = $acct->id()?$acct->intro:'后台自定义';
	    $this->_view['dec'] = $dec;
	    
	}
	
	/**
	 * 关注二维码 /
	 */
	function actionfocus(){

	}
	
	


}